import mockApi from "@/api/mockApi";

export default class enterpriseApi {
  static enterprises=[
    {"id":1,"name":"阳光科技有限公司","establishmentDate":"2015-08-22","registeredAddress":"北京市海淀区中关村大街1号","contactPhone":"010-12345678","email":"info@sunshine-tech.com","officialWebsite":"www.sunshine-tech.com","taxIdentificationNumber":"911101087123456789","createTime":"2024-06-29 20:30:08","modifyTime":"2024-06-06 20:30:08"},
    {"id":2,"name":"蓝天环保有限公司","establishmentDate":"2010-03-07","registeredAddress":"上海市浦东新区张江高科技园区","contactPhone":"021-87654321","email":"contact@bluesky-env.com","officialWebsite":"www.bluesky-env.com","taxIdentificationNumber":"913101157654321987","createTime":"2024-02-14 20:30:08","modifyTime":"2024-11-26 20:30:08"},
    {"id":3,"name":"星辰教育集团","establishmentDate":"2008-01-16","registeredAddress":"广州市天河区珠江新城","contactPhone":"020-34567890","email":"support@staredu.com","officialWebsite":"www.staredu.com","taxIdentificationNumber":"914401017890123456","createTime":"2024-07-18 20:30:08","modifyTime":"2024-06-03 20:30:08"},
    {"id":4,"name":"绿源农业有限公司","establishmentDate":"2012-02-07","registeredAddress":"成都市高新区天府大道","contactPhone":"028-56789012","email":"service@greenfarm.com","officialWebsite":"www.greenfarm.com","taxIdentificationNumber":"915101007654321098","createTime":"2024-03-19 20:30:08","modifyTime":"2024-08-20 20:30:08"},
    {"id":5,"name":"未来智能科技有限公司","establishmentDate":"2018-05-25","registeredAddress":"深圳市南山区科技园","contactPhone":"0755-98765432","email":"info@futureai.com","officialWebsite":"www.futureai.com","taxIdentificationNumber":"914403007890123456","createTime":"2024-10-31 20:30:08","modifyTime":"2024-12-23 20:30:08"},
    {"id":6,"name":"华信金融集团","establishmentDate":"2005-11-15","registeredAddress":"杭州市西湖区文三路","contactPhone":"0571-23456789","email":"service@huaxinfinance.com","officialWebsite":"www.huaxinfinance.com","taxIdentificationNumber":"913301057654321234","createTime":"2024-09-10 20:30:08","modifyTime":"2024-07-15 20:30:08"},
    {"id":7,"name":"天翼物流有限公司","establishmentDate":"2017-04-30","registeredAddress":"武汉市东湖高新区","contactPhone":"027-87654321","email":"info@tianyilogistics.com","officialWebsite":"www.tianyilogistics.com","taxIdentificationNumber":"914201007890123456","createTime":"2024-05-12 20:30:08","modifyTime":"2024-04-18 20:30:08"},
    {"id":8,"name":"创新医疗科技有限公司","establishmentDate":"2019-07-10","registeredAddress":"南京市鼓楼区中山路","contactPhone":"025-34567890","email":"contact@innovamed.com","officialWebsite":"www.innovamed.com","taxIdentificationNumber":"913201057654321345","createTime":"2024-08-05 20:30:08","modifyTime":"2024-09-22 20:30:08"}
  ]

  static async save (params) {
    console.log('enterpriseApi save params', params)
    const response = await mockApi.operateSuccessfully()
    return response.data
  }

  static async find (params) {
    console.log('enterpriseApi find params', params)
    const response = await mockApi.queryPageSuccessfully(enterpriseApi.enterprises)
    return response.data
  }

  static async findById (id) {
    console.log('enterpriseApi findById id', id)
    let target = {}
    for (let a of enterpriseApi.enterprises) {
      if (a.id === id) {
        target = a
      }
    }
    const response = await mockApi.queryByIdSuccessfully(target)
    return response.data
  }

  static async del (id) {
    console.log('enterpriseApi del id', id)
    const response = await mockApi.operateSuccessfully()
    return response.data
  }
}